//
//  BTEIDInfomationAlertViewController.swift
//  BTE
//
//  Created by Mike Zhang on 2025/8/18.
//

import UIKit

class BTEIDInfomationAlertViewController: BTEAlertViewController {
    
    var acti:(()->())?
    
    let imagev = UIImageView.init(image: UIImage.init(named: "Group efweew1171277256"))
    
    private let tit = UILabel()
    
    let box1 = UIView()
    let b1 = UILabel()
    let t1text = UITextField()
    
    let box2 = UIView()
    let b2 = UILabel()
    let t2text = UITextField()
    
    let box3 = UIView()
    let b3 = UILabel()
    let t3text = UILabel()
    
    let tit2 = UILabel()

    override func viewDidLoad() {
        super.viewDidLoad()

        mainv.addSubview(imagev)
        imagev.snp.makeConstraints { make in
            make.edges.equalToSuperview()
            make.height.equalTo((UIScreen.main.bounds.width - 17 - 17) * imagev.frame.height / imagev.frame.width)
        }
        
        tit.textColor = .colorWithHex("#082252")
        tit.font = .systemFont(ofSize: 18, weight: .bold)
        tit.textAlignment = .center
        tit.text = BTELanguageManager.shared.localizedString(forKey: "Please confirm")
        mainv.addSubview(tit)
        tit.snp.makeConstraints { make in
            make.centerX.equalToSuperview()
            make.top.equalToSuperview().offset(44)
        }
        
        imagev.isUserInteractionEnabled = true
        
        imagev.addSubview(box1)
        imagev.addSubview(box2)
        imagev.addSubview(box3)
        
        box1.backgroundColor = .white
        box1.roundCorners(.allCorners, radius: 12)
        box1.layer.borderWidth = 3
        box1.layer.borderColor = UIColor.colorWithHex("#082252")!.cgColor
        
        box2.backgroundColor = .white
        box2.roundCorners(.allCorners, radius: 12)
        box2.layer.borderWidth = 3
        box2.layer.borderColor = UIColor.colorWithHex("#082252")!.cgColor
        
        box3.backgroundColor = .white
        box3.roundCorners(.allCorners, radius: 12)
        box3.layer.borderWidth = 3
        box3.layer.borderColor = UIColor.colorWithHex("#082252")!.cgColor
        
        box1.snp.makeConstraints { make in
            make.left.right.equalToSuperview().inset(35)
            make.height.equalTo(90)
            make.top.equalTo(tit.snp.bottom).offset(22)
        }
        
        box2.snp.makeConstraints { make in
            make.left.right.equalToSuperview().inset(35)
            make.height.equalTo(90)
            make.top.equalTo(box1.snp.bottom).offset(12)
        }
        
        box3.snp.makeConstraints { make in
            make.left.right.equalToSuperview().inset(35)
            make.height.equalTo(90)
            make.top.equalTo(box2.snp.bottom).offset(12)
        }
        
        imagev.addSubview(tit2)
        tit2.numberOfLines = 0
        tit2.textAlignment = .center
        tit2.textColor = .colorWithHex("#F14857")
        tit2.font = .systemFont(ofSize: 14,weight: .bold)
        //tit2.text = BTELanguageManager.shared.localizedString(forKey: "Please check your lD information correctly, once submitted it is not changed again")
        tit2.snp.makeConstraints { make in
            make.left.right.equalToSuperview().inset(35)
            make.top.equalTo(box3.snp.bottom).offset(12)
        }
        
        b1.textColor = .black
        b1.font = .systemFont(ofSize: 16, weight: .bold)
        //b1.text = BTELanguageManager.shared.localizedString(forKey: "Name")
        
        b2.textColor = .black
        b2.font = .systemFont(ofSize: 16, weight: .bold)
        //b2.text = BTELanguageManager.shared.localizedString(forKey: "ID number")
        
        b3.textColor = .black
        b3.font = .systemFont(ofSize: 16, weight: .bold)
        //b3.text = BTELanguageManager.shared.localizedString(forKey: "Birthday")
        
        box1.addSubview(b1)
        box2.addSubview(b2)
        box3.addSubview(b3)
        
        b1.snp.makeConstraints { make in
            make.top.equalToSuperview().offset(14)
            make.left.equalToSuperview().offset(16)
        }
        
        b2.snp.makeConstraints { make in
            make.top.equalToSuperview().offset(14)
            make.left.equalToSuperview().offset(16)
        }
        
        b3.snp.makeConstraints { make in
            make.top.equalToSuperview().offset(14)
            make.left.equalToSuperview().offset(16)
        }
        
        t1text.font = .systemFont(ofSize: 14,weight: .bold)
        //t1text.text = "few"
        t1text.textColor = .black
        box1.addSubview(t1text)
        t1text.snp.makeConstraints { make in
            make.left.equalTo(b1)
            make.right.equalToSuperview().offset(-12)
            make.height.equalTo(44)
            make.top.equalTo(b1.snp.bottom).offset(10)
        }
        
        t2text.font = .systemFont(ofSize: 14,weight: .bold)
        //t2text.text = "few"
        t2text.textColor = .black
        box2.addSubview(t2text)
        t2text.snp.makeConstraints { make in
            make.left.equalTo(b2)
            make.right.equalToSuperview().offset(-12)
            make.height.equalTo(44)
            make.top.equalTo(b2.snp.bottom).offset(10)
        }
        
        
        t3text.font = .systemFont(ofSize: 14,weight: .bold)
        //t3text.text = "few"
        t3text.textColor = .black
        box3.addSubview(t3text)
        t3text.snp.makeConstraints { make in
            make.left.equalTo(b3)
            make.right.equalToSuperview().offset(-12)
            make.height.equalTo(44)
            make.top.equalTo(b3.snp.bottom).offset(10)
        }
        t3text.isUserInteractionEnabled = true
        let ta = UITapGestureRecognizer.init(target: self, action: #selector(clicktime))
        t3text.addGestureRecognizer(ta)
    }
    
    @objc func clicktime(){
        acti?()
    }
    


}
